package util;

import java.io.IOException;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

public class JustIdSerializer extends JsonSerializer<Entity> {

	@Override
	public void serialize(Entity entity, JsonGenerator jsonGenerator,
			SerializerProvider arg2) throws IOException,
			JsonProcessingException {

		jsonGenerator.writeStartObject();
		jsonGenerator.writeNumberField("id", entity.getId());
		jsonGenerator.writeEndObject();
	}

}
